// 对外暴露配置路由

export const constantRoute = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: '登录',
      hidden: true,
      icon: 'Promotion'
    }
  },
  {
    path: "/",
    name: "Layout",
    component: () => import("@/layout/index.vue"),
    redirect: '/home',
    meta: {
      title: 'Layout',
      hidden: true,
      icon: 'HomeFilled'
    },
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          hidden: false,
          icon: 'HomeFilled'
        }
      },
    ],
  },
  // 数据大屏
  {
    path: '/screen',
    name: 'Screen',
    component: () => import('@/views/screen/index.vue'),
    meta: {
      title: '数据大屏',
      hidden: false,
      icon: 'DataBoard'
    }
  },
  // 权限管理
  {
    path: '/acl',
    name: 'ACL',
    component: () => import("@/layout/index.vue"),
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'Setting',
    },
    // 重定向到子路由第一项
    redirect: '/acl/user',
    children: [
      {
        path: '/acl/user',
        name: 'User',
        component: () => import('@/views/acl/user/index.vue'),
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'UserFilled'
        }
      },
      {
        path: '/acl/role',
        name: 'Role',
        component: () => import('@/views/acl/role/index.vue'),
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'PriceTag'
        }
      },
      {
        path: '/acl/permission',
        name: 'Permission',
        component: () => import('@/views/acl/permission/index.vue'),
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'Grid'
        }
      }
    ]
  },
  // 商品管理
  {
    path: '/product',
    name: 'Product',
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "商品管理",
      hidden: false,
      icon: 'GoodsFilled'
    },
    // 重定向到子路由第一项
    redirect: '/product/brand',
    children: [
      {
        path: '/product/brand',
        name: 'Brand',
        component: () => import('@/views/product/brand/index.vue'),
        meta: {
          title: '品牌管理',
          hidden: false,
          icon: 'PictureRounded'
        }
      },
      {
        path: '/product/attr',
        name: 'Attr',
        component: () => import('@/views/product/attr/index.vue'),
        meta: {
          title: '属性管理',
          hidden: false,
          icon: 'Coin'
        }
      },
      {
        path: '/product/spu',
        name: 'SPU',
        component: () => import('@/views/product/spu/index.vue'),
        meta: {
          title: 'SPU管理',
          hidden: false,
          icon: 'Goods'
        }
      },
      {
        path: '/product/sku',
        name: 'SKU',
        component: () => import('@/views/product/sku/index.vue'),
        meta: {
          title: 'SKU管理',
          hidden: false,
          icon: 'CollectionTag'
        }
      },
    ]
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/index.vue"),
    meta: {
      title: '404',
      hidden: true,
      icon: 'CloseBold'
    }
  },
  // 任意路由
  {
    path: "/:pathMatch(.*)*",
    name: "Any",
    redirect: "/404",
    meta: {
      title: 'any',
      hidden: true,
      icon: 'More'
    }
  },
];
